home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-eplain-archive / 000004_gisli@timoshen….eecs.umich.edu_Sun Apr 10 10:52:14 1994.msg < prev    next >
Internet Message Format  |  1995-01-08  |  3KB

  1. Received: from liapunov.eecs.umich.edu ([141.212.98.118]) by cs.umb.edu with SMTP id AA22511
  2.   (5.65c/IDA-1.4.4 for <tex-eplain@cs.umb.edu>); Sun, 10 Apr 1994 14:59:30 -0400
  3. Received: from timoshenko.eecs.umich.edu by liapunov.eecs.umich.edu (NX5.67d/NX3.0M)
  4.     id AA03157; Sun, 10 Apr 94 14:52:15 -0400
  5. Received: by timoshenko.eecs.umich.edu (NX5.67d/NX3.0S)
  6.     id AA03093; Sun, 10 Apr 94 14:52:14 -0400
  7. Date: Sun, 10 Apr 94 14:52:14 -0400
  8. From: Gisli Ottarsson <gisli@timoshenko.eecs.umich.edu>
  9. Message-Id: <9404101852.AA03093@timoshenko.eecs.umich.edu>
  10. To: tex-eplain@cs.umb.edu
  11. In-Reply-To: <9404101547.AA05322@cs.rice.edu> (dorai@cs.rice.edu)
  12. Subject: Re: adding indexing to eplain
  13.  
  14. >>>>> On Sun, 10 Apr 94 10:47:06 CDT, dorai@cs.rice.edu (Dorai Sitaram) said:
  15.  
  16.   DS> Have y'all considered adding indexing to eplain?
  17.  
  18. I am very interested in this topic.  Karl (Mr. Berry?) was nice enough
  19. to send me his preliminary ideas for extensions to eplain, that
  20. included some indexing features.  Alas, I had a time constraint that
  21. prevented me from understanding and adopting his macros so I have been
  22. making use of idxmac.tex + "enhancements".
  23.  
  24.   DS> Right now, I find I get neat indexes by \input'ing idxmac.tex
  25.   DS> (available on CTAN).  
  26.  
  27. I was less happy with straight idxmac.tex.  I found that I was unable
  28. to use \index it in all the places I liked (I think it had problems
  29. with ignoring spaces).  I borrowed from eplain and rolled this:
  30.  
  31.  
  32. \newif\if@idxfileopened
  33. \newwrite\idxfile
  34. \let\idxfilebasename = \jobname
  35. \def\openidxfile{%
  36.   \if@idxfileopened\else
  37.      \global\@idxfileopenedtrue
  38.      \immediate\openout\idxfile = \idxfilebasename.idx
  39.   \fi
  40. }%
  41. \newif\ifrewriteidxfile   \rewriteidxfiletrue
  42. \def\readidxfile{%
  43.    \testfileexistence[\idxfilebasename]{idx}%
  44.    \if@fileexists
  45.       \input \idxfilebasename.idx
  46.       \ifrewriteidxfile \openidxfile \fi
  47.    \fi
  48. }%
  49.  
  50. \def\index#1{%
  51.   \ifrewriteidxfile
  52.     \openidxfile
  53.     \toks0 = {\expandafter\noexpand \csname indexentry\endcsname}%
  54.     \def\temp{#1}%
  55.     \edef\@wr{%
  56.       \write\idxfile{%
  57.         \the\toks0
  58.         {\sanitize\temp}%
  59.         {\noexpand\folio}%
  60.       }%
  61.     }%
  62.     \@wr
  63.   \fi
  64.   \ignorespaces
  65. }%
  66.  
  67. Needless to say I don't have a clue what half of this means, 
  68. but I found that as long as I leave a space before \index
  69. I get the proper .idx file for makeindex.  
  70.  
  71. I too think that I nice interface to makeindex would be a nice
  72. addition to the eplain arsenal.
  73.  
  74. Thanks for eplain
  75.  
  76.             Gisli
  77.  
  78.  
  79. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  80. Gisli Ottarsson                                   
  81. Grad Student and a Gentleman              
  82.                                                    Delenda est Carthago.      
  83. University of Michigan                         
  84. gisli@umich.edu
  85.  
  86. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~